<template>
  <div class="box">
    <div class="top">
      <p class="title">实时游客统计</p>
      <img src="../images/dataScreen-title.png" alt="" />
      <div class="right">
        可预约总数 <span> {{ pop }} </span>
      </div>
    </div>
    <div class="number">
      <span class="" v-for="item in pop" :key="item">
        {{ item }}
      </span>
    </div>

    <div class="charts" ref="charts">1231</div>
  </div>
</template>

<script setup lang="ts">
import * as echarts from "echarts";
import "echarts-liquidfill";
import { ref, onMounted } from "vue";

let charts = ref();

onMounted(() => {
  let mycharts = echarts.init(charts.value);
  mycharts.setOption({
    series: [
      {
        type: "liquidFill",
        waveAnimation: true,
        animationDuration: 3,
        animationDurationUpdate: 3,
        data: [0.6, 0.5, 0.4, 0.3],
        radius: "90%",
        itemStyle: {
          borderWidth: 5,
          borderColor: "#156ACF",
          shadowBlur: 20,
          shadowColor: "rgba(255, 0, 0, 1)",
        },
      },
    ],
  });
});
let pop = ref("12314人");
</script>

<style scoped lang="scss">
.box {
  background: url(../images/dataScreen-main-lb.png) no-repeat;
  background-size: 100% 100%;
  margin-top: 10px;
  .top {
    .title {
      color: aliceblue;
      font-size: 20px;
    }

    .right {
      display: flex;
      justify-content: flex-end;
      color: #fff;
      font-size: 20px;
      span {
        color: yellowgreen;
        margin: 0 15px;
      }
    }
  }

  .number {
    margin-top: 20px;
    display: flex;
    padding: 10px;
    span {
      flex: 1;
      height: 40px;
      line-height: 40px;
      background: url(../images/total.png) no-repeat;
      background-size: 100% 100%;
      text-align: center;
      color: #fff;
    }
  }
}

.charts {
  width: 100%;
  height: 240px;
}
</style>
